const {
  ApiGenerator
} = require('jws-tools-wx');

const {
  genApi,
  setApiConfig
} = new ApiGenerator("https://api.jiuwusan.cn/api");
//配置Api
setApiConfig({
  //拦截器
  interceptors: (options) => {
    console.log("拦截到请求==", options);
  },
  //异常处理
  onError: (error) => {
    console.log("请求错误==", error);
  }
});

// 用户相关api
const userApi = genApi({
  //登录
  login: 'POST /auth/login',
  //获取签到列表
  getSignDataList: 'POST /sexual/:userid/getDataList'
});

//向外暴露方法
module.exports = {
  userApi
}